<template>
  <div class="nav">
    <div class="name">
      <span class="name1">{{ name1 }}</span>
      <span class="name2">{{ name2 }}</span>
    </div>
    <div class="mid">
      <div v-for="item in list1" :key="item.id" class="mid-item">
        <el-icon :size="20" color="rgb(0, 153, 255)"><component :is="item.icon"></component></el-icon>
        <span>{{ item.name }}</span>
      </div>
    </div>
    <div class="right">
      <div v-for="item in list2" :key="item.id" class="mid-item">
        <el-icon :size="20" color="rgb(0, 153, 255)"><component :is="item.icon"></component></el-icon>
        <span>{{ item.name }}</span>
      </div>
      <div class="mid-item">
        <el-icon :size="20" color="rgb(0, 153, 255)"><User /></el-icon>
        <span style="margin-right:5px">用户</span>
        <el-icon :size="20" color="rgb(0, 153, 255)"><CaretBottom /></el-icon>
      </div>
    </div>
  </div>
  
</template>

<script lang="ts">
import { defineComponent } from "vue";
export default defineComponent({
  setup() {
    const name1: string = "客户资源信息";
    const name2: string = "管理后台";
    const list1: Array<{ id: number; name: string; icon: string }> = [
      {
        id: 1,
        name: "权限管理",
        icon: "Lock",
      },
      {
        id: 2,
        name: "用户管理",
        icon: "Stamp",
      },
      {
        id: 3,
        name: "系统日志",
        icon: "Calendar",
      },
    ];
    const list2: Array<{ id: number; name: string; icon: string }> = [
      {
        id: 0,
        name: "在线人数",
        icon: "DataLine",
      },
      {
        id: 1,
        name: "系统消息",
        icon: "Bell",
      },
    ];
    return {
      name1,
      name2,
      list1,
      list2
    };
  },
});
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped lang="less">
.nav {
  width: 100%;
  height: 60px;
  background-color: rgb(27, 38, 55);
}
.name {
  width: 200px;
  height: 100%;
  line-height: 60px;
  margin-left: 30px;
  float: left;
}
.name1 {
  font-size: 20px;
  color: rgb(0, 153, 255);
}
.name2 {
  font-size: 20px;
  color: white;
}
.mid {
  float: left;
  width: 450px;
  height: 60px;
  margin-left: 150px;
}
.mid-item {
  float: left;
  width: 100px;
  margin-left: 25px;
  margin-right: 25px;
  height: 60px;
  line-height: 60px;
  color: #aeaeae;
  text-align: center;
}
.right{
  float: right;
  width: 450px;
  height: 60px;
}
</style>
